Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #110/ac1351a5 backport][stable-1] Fix exos_config:save_when when a stopped process is present #343

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Dec 7, 2021

This is a backport of PR #110 as merged into main (ac1351a).

SUMMARY

NOTE: This is distinct from Bug #109, which I filed earler!

When a stopped process exists on the Switch, the prompt for the save command changes. This trips up save_when, which does not recognize the prompt and it runs into a timeout.

commit message:

When a process is created, and then terminated but not deleted, the
save config prompt will change. This module expected the old prompt,
which never arrived, so the save will run into a timeout.

This is how the special prompt looks:

  • Slot-1 HOSTNAMEHERE.1 # save
    The configuration file primary.cfg already exists.
    Some process has been terminated/stopped. If you save the configuration
    then that process's configuration will be lost.
    Do you want to continue? (y/N)
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

exos_config

ADDITIONAL INFORMATION
---
- hosts: all
  connection: network_cli
  user: uedvt359
  vars: 
    ansible_network_os: exos
    
  tasks:
  - name: create a process and make sure it was started at least once
    exos_config: 
      commands:
      - create process testProcess python-module __future__ start on-demand vr VR-Mgmt
      - start process testProcess
      save_when: changed

  - name: stop the saved process
    exos_config: 
      commands:
      - terminate process testProcess forceful

  - name: this will fail, since the prompt is unexpected
    exos_config:
      save_when: always

When a process is created, and then terminated but not deleted, the
save config prompt will change. This module expected the old prompt,
which never arrived, so the save will run into a timeout.

This is how the special prompt looks:
> * Slot-1 HOSTNAMEHERE.1 # save
> The configuration file primary.cfg already exists.
> Some process has been terminated/stopped. If you save the configuration
> then that process's configuration will be lost.
> Do you want to continue? (y/N)

(cherry picked from commit ac1351a)
@dericcrago dericcrago merged commit dde4f99 into stable-1 Dec 7, 2021
@dericcrago dericcrago deleted the patchback/backports/stable-1/ac1351a5f799f820cbd4f1bf3b42793b8ae97e2d/pr-110 branch December 7, 2021 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants